package classes.view.component
{
	import com.d4p.util.ZeroStringUtil;
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class QuizTimerClip extends MovieClip
	{
		private var _textA:TextField;
		private var _clipA:MovieClip;
		private var _textB:TextField;
		private var _clipB:MovieClip;
		private var _textC:TextField;
		private var _clipC:MovieClip;
		private var _textD:TextField;
		private var _clipD:MovieClip;
		
		public function QuizTimerClip()
		{
			super();
			defaultSetting();
			setLayOut();
		}
		
		public function set timerIn($param:int):void
		{
			//trace($param);
			this._textA.text = ZeroStringUtil.getZeroInstance().digit($param);
			this._textB.text = ZeroStringUtil.getZeroInstance().digit($param+1);
			this._textC.text = ZeroStringUtil.getZeroInstance().digit($param+1);
			this._textD.text = ZeroStringUtil.getZeroInstance().digit($param);
			
			this.gotoAndPlay(1);
		}
		
		
		
		private function defaultSetting():void
		{
			this.stop();
		}
		
		private function setLayOut():void
		{
			this._clipA = this.getChildByName('a0_mc')					as MovieClip;
			this._textA = this._clipA.a_mc.getChildByName("min_text") 	as TextField; 
			this._clipB = this.getChildByName('a1_mc')					as MovieClip;
			this._textB = this._clipB.a_mc.getChildByName("min_text") 	as TextField; 
			this._clipC = this.getChildByName('a2_mc')					as MovieClip;
			this._textC = this._clipC.a_mc.getChildByName("min_text") 	as TextField; 
			this._clipD = this.getChildByName('a3_mc')					as MovieClip;
			this._textD = this._clipD.a_mc.getChildByName("min_text") 	as TextField; 
		}
	}
}